#include <stm8s_clk.h>

void CLK_HSECmd(FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONALSTATE_OK(NewState));
  
  if (NewState != DISABLE)
  {
    /* Set HSEEN bit */
    CLK->ECKR |= CLK_ECKR_HSEEN;
  }
  else
  {
    /* Reset HSEEN bit */
    CLK->ECKR &= (uint8_t)(~CLK_ECKR_HSEEN);
  }
}

/**
  * @brief  Enables or disables the Internal High Speed oscillator (HSI).
  * @param   NewState new state of HSIEN, value accepted ENABLE, DISABLE.
  * @retval None
  */
